/* 
 * Copyright 2008 Rodrigo Reyes <reyes.rr at gmail dot com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you
 * may not use this file except in compliance with the License. You may
 * obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * permissions and limitations under the License.
 **/
package net.kornr.abstractcanvas.client;

import com.google.gwt.widgetideas.graphics.client.CanvasGradient;
import com.google.gwt.widgetideas.graphics.client.Color;

/**
 * The ICanvas interface provides an interface to a Graphics not unlike 
 * the HTML Canvas (but is really based on the GWTCanvas). It is a strict 
 * subset of the html canvas (ie. it does not contain text-drawing methods). 
 * <p>
 * Methods related to Gradients are disabled, due to the IE implementation 
 * not working as expected. The drawImage() methods should be implemented in 
 * a future version.
 * 
 * @author Rodrigo Reyes
 *
 */
public interface ICanvas 
{
	public void arc(double x, double y, double radius, double startAngle, double endAngle, boolean antiClockwise);
	public void beginPath();
	public void clear();
	public void closePath();
	/*
	public CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
	public CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
	 */
	public void cubicCurveTo(double cp1x, double cp1y, double cp2x,	double cp2y, double x, double y);
	/*
	public void drawImage(ImageElement img, double offsetX, double offsetY, double width, double height);
	public void drawImage(ImageElement img, double offsetX, double offsetY);
	 */
	public void fill();
	public void fillRect(double startX, double startY, double width, double height);
	public int getCoordHeight();
	public int getCoordWidth();
	public double getGlobalAlpha();
	public String getGlobalCompositeOperation();
	public String getLineCap();
	public String getLineJoin();
	public double getLineWidth();
	public double getMiterLimit();
	public void lineTo(double x, double y);
	public void moveTo(double x, double y);
	public void quadraticCurveTo(double cpx, double cpy, double x, double y);
	public void rect(double startX, double startY, double width, double height);
	public void resize(int width, int height);
	public void restoreContext();
	public void rotate(double angle);
	public void saveContext();
	public void scale(double x, double y);
	public void setBackgroundColor(Color color);
	public void setCoordHeight(int height);
	public void setCoordSize(int width, int height);
	public void setCoordWidth(int width);
	public void setFillStyle(CanvasGradient grad);
	public void setFillStyle(Color color);
	public void setGlobalAlpha(double alpha);
	public void setGlobalCompositeOperation(String globalCompositeOperation);
	public void setLineCap(String lineCap);
	public void setLineJoin(String lineJoin);
	public void setLineWidth(double width);
	public void setMiterLimit(double miterLimit);
	public void setPixelHeight(int height);
	public void setPixelWidth(int width);
	public void setStrokeStyle(CanvasGradient grad);
	public void setStrokeStyle(Color color);
	public void stroke();
	/*
	public void strokeRect(double startX, double startY, double width, double height);
	public void transform(double m11, double m12, double m21, double m22, double dx, double dy);
	 */
	public void translate(double x, double y);
}
